<%-- 
    Document   : wantToConnect
    Created on : Jun 20, 2014, 12:58:16 AM
    Author     : Yogesh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%

                    String name=(String)request.getParameter("name");
                    String mobileNumber=(String)request.getParameter("mobile");
                    String email=(String)request.getParameter("email");
                    String pageName=(String)request.getParameter("pageName");


                    org.hibernate.SessionFactory sessionFactory=com.Auto.Common.ConnectWithUs.ConnectWithUs_HibernateUtil.getSessionFactory();
                    org.hibernate.Session Opensession=sessionFactory.openSession();
                    org.hibernate.Transaction transaction=Opensession.beginTransaction();

                    com.Auto.Common.ConnectWithUs.Connectwithus connectwithus=new com.Auto.Common.ConnectWithUs.Connectwithus(name, mobileNumber, email);
                    Opensession.save(connectwithus);
                    transaction.commit();

                   session.setAttribute("data","wantToConnect");
                   session.setAttribute("pageName",pageName);


                    response.sendRedirect("thankYouMessage.jsp");

        %>
    </body>
</html>
